home *** CD-ROM | disk | FTP | other *** search
- // PatchView.h
- // By Jayson Adams, NeXT Developer Support Team
- // You may freely copy, distribute and reuse the code in this example.
- // NeXT disclaims any warranty of any kind, expressed or implied, as to its
- // fitness for any particular use.
-
- #import <appkit/View.h>
- #import "UnitGen.h"
-
- #define UGENS 26
- #define NONE 0
- #define MOVING 1
- #define SETTING 2
- #define CONNECTING 3
-
- @interface PatchView:View
- {
- id currentImage;
- int ugenType;
- id delegate;
- id screenImage; // off-screen buffer
- NXPoint currentUgenCenter;
- BOOL connecting;
- BOOL selecting;
- BOOL moving;
- BOOL setting;
- BOOL firstErase;
- BOOL ugenselected;
- NXPoint *connPoint1;
- NXPoint *connPoint2;
- NXPoint erasePoint1;
- NXPoint erasePoint2;
- NXPoint *ePoint1;
- NXPoint *ePoint2;
- NXRect *hrect;
- id currentUgen;
- id currentParam;
- id connUgen1;
- id connParam1;
- id eraseParam;
- id outUgen;
- id paramVal;
- int choice;
- int viewMode;
- }
-
- /* instance methods */
- - setImages;
- - windowChanged:newWindow;
- - setUgen:(int)uType;
- - setDelegate:anObject;
- - (BOOL)windowEntered:dragSource;
- - (BOOL)windowExited:dragSource;
- - (BOOL)windowDropped:dragSource:(NXPoint *)currentLocation;
- - erase:sender;
- - mouseDraggedAction:(NXPoint *)currentLocation;
- - mouseUpAction:(NXPoint *)currentLocation;
- - drawSelf:(NXRect *)rects :(int)count;
-
- /* delegation methods */
- - acceptedWindow:acceptView fromSource:source;
-
- @end
-